package com.example.consumer;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 使用rabbitmq
 * 1.只要引入amqp场景，RabbitAutoConfiguration就会自动生效
 * 2.给容器中自动配置了RabbitTemplate、AmqpAdmin、CachingConnectionFactory、RabbitMessagingTemplate
 *  所有属性都是spring.rabbitmq --> @ConfigurationProperties(prefix = "spring.rabbitmq")
 * 3.给配置文件中配置 spring.rabbitmq 信息
 * 4.@EnableRabbit
 * 5.监听消息：使用@RabbitListener必须有@EnableRabbit(通过工程1来看没有@EnableRabbit注解也不耽误监听。@Componet注解导致的？)
 */
@EnableRabbit
@SpringBootApplication
public class Rabbitmq2ConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(Rabbitmq2ConsumerApplication.class, args);
    }

}
